$(".logout-btn").click(() => {
    $.ajax({
        url: "http://www.woniu-news.com:8082/logout.php",
        type: "GET",
        dataType: "json",
        xhrFields: {
            withCredentials: true
        },
        success: (resp) => {
            if (resp.code === 200) {
                alert(resp.message)
                window.location.href = "index.html"
            } else {
                alert(resp.message)
                window.location.href = "index.html"
            }
        },
        error: (resp) => {
            alert(resp.message)
        }
    })
})